﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="URL_sever.aspx.cs" Inherits="Mobile_URL_sever" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="script/common.js"></script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
        </div>
    </form>
    <script>
        (function (win, doc) {
            var go = {
                appid: "wxc074159c55beed9c",
                scope :"snsapi_base",
                url: function () {
                    var code = GetRequest()["code"];
                    if (code) {
                        switch (code) {
                            case 1:
                                return encodeURIComponent("http://vip2.douqushenghuo.com/Mobile/test.aspx");
                                break;
                            case 2:
                                return encodeURIComponent("http://vip2.douqushenghuo.com/Mobile/test.aspx");
                                break;
                            default:
                                
                                return encodeURIComponent("http://vip2.douqushenghuo.com/Mobile/test.aspx");
                        }
                    } else {
                        return encodeURIComponent("http://vip2.douqushenghuo.com/Mobile/test.aspx");
                    }
                }(),
                processing: function () {
                    var url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={0}&redirect_uri={1}&response_type=code&scope={2}&state={3}#wechat_redirect";
                    url = url.format(this.appid, this.url,this.scope,"a");
                    win.location.href = url;
                },
                open: function () {
                    document.addEventListener('DOMContentLoaded', function () {
                        go.processing().bind(go);
                    }, false)
                }()
            }
        })(window, document)
    </script>
</body>
</html>
